﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Metro.Kashikoi.ServiceContract.Security;
using Metro.Kashikoi.Service.Common.Entity;
using Metro.Kashikoi.ServiceContract.Location;

namespace Metro.Kashikoi.Service.Security.Business
{
    interface ISecurityFacade
    {
        /// <summary>
        /// Ceaetes the user.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        void CeaeteUser(IUnitOfWork context, User user);

        /// <summary>
        /// Updates the user.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="user">The user.</param>
        void UpdateUser(IUnitOfWork context, User user);

        /// <summary>
        /// Deletes the user.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="Id">The id.</param>
        void DeleteUser(IUnitOfWork context, int Id);

        /// <summary>
        /// Gets all users.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        IList<User> GetAllUsers(IUnitOfWork context);

        /// <summary>
        /// Gets the user list.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="userGroupId">The user group id.</param>
        /// <returns></returns>
        IList<User> GetUserList(IUnitOfWork context, int userGroupId);

        /// <summary>
        /// Gets the user by id.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        User GetUserById(IUnitOfWork context, int id);

        /// <summary>
        /// Gets the user by login.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="login">The login.</param>
        /// <returns></returns>
        User GetUserByLogin(IUnitOfWork context, string login);

        /// <summary>
        /// Mantains the GRP id.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="user">The user.</param>
        void MantainGrpId(IUnitOfWork context, User user);

        /// <summary>
        /// Validates the user.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="id">The id.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        bool ValidateUser(IUnitOfWork context, string id, string password);

        /// <summary>
        /// Ceaetes the user group.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="userGroup">The user group.</param>
        /// <returns></returns>
        void CeaeteUserGroup(IUnitOfWork context, UserGroup userGroup);

        /// <summary>
        /// Updates the user group.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="userGroup">The user group.</param>
        void UpdateUserGroup(IUnitOfWork context, UserGroup userGroup);

        /// <summary>
        /// Deletes the user group.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="Id">The id.</param>
        void DeleteUserGroup(IUnitOfWork context, int Id);

        /// <summary>
        /// Gets all user groups.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        IList<UserGroup> GetAllUserGroups(IUnitOfWork context);

        /// <summary>
        /// Adds the user.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="user">The user.</param>
        /// <param name="userGroup">The user group.</param>
        void AddUser(IUnitOfWork context, User user, UserGroup userGroup);

        /// <summary>
        /// Removes the user.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="user">The user.</param>
        /// <param name="userGroup">The user group.</param>
        void RemoveUser(IUnitOfWork context, User user, UserGroup userGroup);

        /// <summary>
        /// Gets the user group by id.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        UserGroup GetUserGroupById(IUnitOfWork context, int id);

        /// <summary>
        /// Adds the route.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="userGroup">The user group.</param>
        /// <param name="region">The region.</param>
        void AddRoute(IUnitOfWork context, UserGroup userGroup, Region region);

        void RemoveRoute(IUnitOfWork context, UserGroup userGroup, Region region);
    }
}
